package Easy;

public class LC1732 {
    public int largestAltitude(int[] gain) {
        int altitude = 0, maxAltitude = 0;
        for (int value : gain) {
            altitude += value;
            if (altitude > maxAltitude) maxAltitude = altitude;
        }
        return maxAltitude;
    }
}
